home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "Form1"
- ClientHeight = 5595
- ClientLeft = 1170
- ClientTop = 1545
- ClientWidth = 4830
- Height = 6000
- Left = 1110
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- ScaleHeight = 5595
- ScaleWidth = 4830
- Top = 1200
- Width = 4950
- Begin CommandButton Command2
- Caption = "DONE"
- Height = 735
- Left = 3000
- TabIndex = 3
- Top = 4800
- Width = 1575
- End
- Begin CommandButton Command1
- Caption = "Sideways Print Test: GO"
- Height = 735
- Left = 240
- TabIndex = 0
- Top = 4800
- Width = 2535
- End
- Begin PictureBox Pic
- Height = 3615
- Left = 120
- ScaleHeight = 3585
- ScaleWidth = 4545
- TabIndex = 4
- Top = 1080
- Width = 4575
- End
- Begin Label Label2
- Height = 375
- Left = 960
- TabIndex = 2
- Top = 600
- Width = 2775
- End
- Begin Label Label1
- Height = 375
- Left = 360
- TabIndex = 1
- Top = 120
- Width = 4095
- End
- Sub Command1_Click ()
- Dim hFont As Integer, hOldFont As Integer
- Dim Font As LOGFONT
- '-- get Text capabilites for rotating characters
- ' Funny Note: There's a POLYGONALCAPS capability which determines whether the device can
- ' do interiors. I wonder if I can hire it to redecorate my place? 8-)
- nValue = GetDeviceCaps(Form1.hDC, TEXTCAPS)
- Label2.Caption = "TEXTCAPS" + ":" + Hex$(nValue)
- If (nValue And TC_CR_90) = 0 Then
- Label1.Caption = "No Character Rotation is Available"
- If (nValue And TC_CR_ANY) = 0 Then
- Label1.Caption = "90 Degree Character Rotation Available"
- Else
- Label1.Caption = "Any Degree Character Rotation Available"
- End If
- End If
- '-- Note: at this point if it can't do CharRot's, then we should stop, but we'll blindly
- ' forge ahead to see what happens.
- Font.lfHeight = 24 '-- 24 point size
- Font.lfWidth = 0'-- let Windows figure out the appropriate width based on the height
- Font.lfEscapement = 900'-- rotate 270 degrees (bottom to top)
- Font.lfOrientation = 900 '-- normal character orientation (straight up)
- Font.lfPitchAndFamily = Chr$(VARIABLE_PITCH Or FF_MODERN)
- Font.lfCharSet = Chr$(OEM_CHARSET) '-- this is important!
- Font.lfQuality = Chr$(PROOF_QUALITY)
- Font.lfWeight = FW_NORMAL
- 'Note: italic, underline, strikeout, charset, outprecision,
- ' clipprecision, and quality are 0 (default)
- Font.lfFaceName = "Modern"'-- Windows' "Modern" font
- '-- get the handle to the font we specify
- hFont = CreateFontIndirect(Font)
- '-- now let's select it to our current Printer hDC
- hOldFont = SelectObject(Pic.hDC, hFont)
- szFaceName$ = Space$(80)
- retval% = GetTextFace(Pic.hDC, 79, szFaceName$)
- Label2.Caption = Label2.Caption + " " + szFaceName$
- '-- let's test it out!
- SomeText$ = "This is a test of sideways text 1234567890."
- nChars = Len(SomeText$)
- Pic.CurrentX = 200
- Pic.CurrentY = 3000
- Pic.Print "Print Test 1234567890"
- '-- don't forget to delete the object
- DeleteObject hFont
- End Sub
- Sub Command2_Click ()
- End Sub
-